-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update ASCII scalar function to support Utf8View #11834 #11884
Conversation
c94858c
to
3dddecc
Compare
let string_array = args[0].as_string_view(); | ||
calculate_ascii(string_array.iter()) | ||
} | ||
_ => unreachable!(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we return internal_err!("Unsupported data type")
instead of panic here?
|
||
fn calculate_ascii<'a, I>(string_array: I) -> Result<ArrayRef> | ||
where | ||
I: IntoIterator<Item = Option<&'a str>>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I: IntoIterator<Item = Option<&'a str>>, | |
I: ArrayAccessor<Item = &'a str>, |
As exampled in https://github.com/apache/arrow-rs/blob/e28cf44e65cdd1fefaa1b857ca4336e7a9da5d06/arrow-array/src/array/mod.rs#L487-L507
e380fa1
to
dad81cf
Compare
dad81cf
to
ea14dbc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great to me -- thank you @dmitrybugakov and @XiangpengHao for the revieww
Which issue does this PR close?
Closes #11834.
Rationale for this change
What changes are included in this PR?
Are these changes tested?
Are there any user-facing changes?